package com.javasm.mb_store_api_final.sys_control.usercontrol.sys_menu.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * (SysMenu)表实体类
 *
 * @author makejava
 * @since 2024-07-29 20:18:20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysMenu extends Model<SysMenu> implements Serializable{
    private static final long serialVersionUID = 1L;
    //菜单编号
    private Integer id;
    //菜单名称
    private String title;
    //显示排序
    private Integer showOrder;
    //请求地址
    private String path;
    //菜单类型     0目录   1菜单   2按钮
    private Integer menuType;
    //菜单状态  0显示1隐藏
    private Integer menuState;
    //菜单图标
    private String menuFlag;
    //父级菜单 id
    private Integer pid;
    //权限标识
    private String menuPermit;
    //创建时间
    private Date createTime;
    //更新时间
    private Date updateTime;
    //打开方式  0 页签  1新窗口
    private Integer openWay;
    @TableField(exist = false)
    private List<SysMenu> childMenus;

    public boolean checkFirstMenu() {
        return this.getPid() == 0;
    }

}
